package Fuente;
import Comun.clsSaicFrame;
import javax.swing.ComboBoxModel;

public class Donadores2 extends clsSaicFrame {
private javax.swing.JFormattedTextField.AbstractFormatterFactory for1;
private javax.swing.JFormattedTextField.AbstractFormatterFactory for2;
private javax.swing.JFormattedTextField.AbstractFormatterFactory for3;
    boolean ban=false;
    int padre;
    public Donadores2(int x) {
        padre=x;
        initComponents();
        
       
       for1=(this.dataMaskedTextField1.getFormatterFactory());
       this.dataMaskedTextField1.setFormatterFactory(null);
       for2=(this.dataMaskedTextField2.getFormatterFactory());
       this.dataMaskedTextField2.setFormatterFactory(null);
       for3=(this.dataMaskedTextField3.getFormatterFactory());
       this.dataMaskedTextField3.setFormatterFactory(null);
       this.dataSource1.consulta();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dataSource1 = new FuenteDeDatos.DataSource();
        datahabilitador1 = new FuenteDeDatos.Datahabilitador();
        panel1 = new Comun.PanelRoundTranslucido();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        buttonSeven5 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven6 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven7 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven8 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven1 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven3 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven9 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven2 = new org.edisoncor.gui.button.ButtonSeven();
        buttonSeven4 = new org.edisoncor.gui.button.ButtonSeven();
        jLabel10 = new javax.swing.JLabel();
        dataMaskedTextField1 = new FuenteDeDatos.DataMaskedTextField();
        dataTextField1 = new FuenteDeDatos.DataTextField();
        dataTextField2 = new FuenteDeDatos.DataTextField();
        dataTextField3 = new FuenteDeDatos.DataTextField();
        dataRadioButton1 = new FuenteDeDatos.DataRadioButton();
        dataRadioButton2 = new FuenteDeDatos.DataRadioButton();
        dataCombobox1 = new FuenteDeDatos.DataCombobox();
        dataCombobox2 = new FuenteDeDatos.DataCombobox();
        dataTextField4 = new FuenteDeDatos.DataTextField();
        dataMaskedTextField2 = new FuenteDeDatos.DataMaskedTextField();
        dataMaskedTextField3 = new FuenteDeDatos.DataMaskedTextField();
        dataLabel1 = new FuenteDeDatos.DataLabel();
        jLabel11 = new javax.swing.JLabel();
        buttonSeven10 = new org.edisoncor.gui.button.ButtonSeven();

        dataSource1.setCodigosql("select * from vw_donadores2");
        dataSource1.setDb("db_saic");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Donadores");
        setBackground(new java.awt.Color(51, 153, 255));

        panel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setBackground(new java.awt.Color(255, 255, 255));
        jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 30));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Catálogo de Donadores");
        panel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 747, -1));

        jLabel2.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel2.setText("C.U.R.P.");
        panel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 95, 100, 21));

        jLabel3.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel3.setText("Nombre:");
        panel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 141, 100, 21));

        jLabel4.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel4.setText("Apellido Paterno:");
        panel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 183, 147, 21));

        jLabel5.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel5.setText("Apellido  Materno:");
        panel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 229, 147, 21));

        jLabel6.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel6.setText("Sexo:");
        panel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 272, 66, 21));

        jLabel7.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel7.setText("Tipo de Sangre:");
        panel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 314, -1, 21));

        jLabel8.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel8.setText("Dirección:");
        panel1.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 367, 147, 21));

        jLabel9.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel9.setText("Teléfono:");
        panel1.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 403, 147, 21));

        buttonSeven5.setText("<<");
        buttonSeven5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven5ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven5, new org.netbeans.lib.awtextra.AbsoluteConstraints(489, 95, 60, -1));

        buttonSeven6.setText("<");
        buttonSeven6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven6ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven6, new org.netbeans.lib.awtextra.AbsoluteConstraints(561, 95, 44, -1));

        buttonSeven7.setText(">");
        buttonSeven7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven7ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven7, new org.netbeans.lib.awtextra.AbsoluteConstraints(611, 95, 43, -1));

        buttonSeven8.setText(">>");
        buttonSeven8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven8ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven8, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 95, 62, -1));

        buttonSeven1.setText("Guardar");
        buttonSeven1.setEnabled(false);
        buttonSeven1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven1ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven1, new org.netbeans.lib.awtextra.AbsoluteConstraints(611, 148, -1, -1));

        buttonSeven3.setText("Cancelar");
        buttonSeven3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven3ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven3, new org.netbeans.lib.awtextra.AbsoluteConstraints(612, 200, -1, -1));

        buttonSeven9.setText("Buscar");
        buttonSeven9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven9ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven9, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 253, -1, -1));

        buttonSeven2.setText("Modificar");
        buttonSeven2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven2ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven2, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 200, -1, -1));

        buttonSeven4.setText("Nuevo");
        buttonSeven4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven4ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven4, new org.netbeans.lib.awtextra.AbsoluteConstraints(489, 148, -1, -1));

        jLabel10.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel10.setText("Fecha de Nacimiento:");
        panel1.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 440, -1, 21));

        dataMaskedTextField1.setCampo("donador_id");
        dataMaskedTextField1.setData(dataSource1);
        dataMaskedTextField1.setEnabled(false);
        try {
            dataMaskedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("UUUU######UUUUUU##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        dataMaskedTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                dataMaskedTextField1FocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                dataMaskedTextField1FocusLost(evt);
            }
        });
        panel1.add(dataMaskedTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(203, 92, 240, -1));

        dataTextField1.setCampo("nombre");
        dataTextField1.setData(dataSource1);
        dataTextField1.setEnabled(false);
        panel1.add(dataTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(203, 138, 240, -1));

        dataTextField2.setCampo("apellido_p");
        dataTextField2.setData(dataSource1);
        dataTextField2.setEnabled(false);
        panel1.add(dataTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(203, 180, 240, -1));

        dataTextField3.setCampo("apellido_m");
        dataTextField3.setData(dataSource1);
        dataTextField3.setEnabled(false);
        panel1.add(dataTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(203, 226, 240, -1));

        dataRadioButton1.setForeground(new java.awt.Color(255, 255, 255));
        dataRadioButton1.setText("Maculino");
        dataRadioButton1.setCampo("sexo");
        dataRadioButton1.setData(dataSource1);
        dataRadioButton1.setEnabled(false);
        dataRadioButton1.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 14));
        dataRadioButton1.setValor("M");
        dataRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dataRadioButton1ActionPerformed(evt);
            }
        });
        panel1.add(dataRadioButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 270, -1, -1));

        dataRadioButton2.setForeground(new java.awt.Color(255, 255, 255));
        dataRadioButton2.setText("Femenino");
        dataRadioButton2.setCampo("sexo");
        dataRadioButton2.setData(dataSource1);
        dataRadioButton2.setEnabled(false);
        dataRadioButton2.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 14));
        dataRadioButton2.setValor("F");
        dataRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dataRadioButton2ActionPerformed(evt);
            }
        });
        panel1.add(dataRadioButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 270, -1, -1));

        dataCombobox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "", "A", "B", "AB", "O" }));
        dataCombobox1.setCampo("tipo_sangre");
        dataCombobox1.setData(dataSource1);
        dataCombobox1.setEnabled(false);
        dataCombobox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dataCombobox1ActionPerformed(evt);
            }
        });
        panel1.add(dataCombobox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 310, 92, -1));

        dataCombobox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "", "+", "-" }));
        dataCombobox2.setCampo("rh");
        dataCombobox2.setData(dataSource1);
        dataCombobox2.setEnabled(false);
        panel1.add(dataCombobox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 310, -1, -1));

        dataTextField4.setCampo("direccion");
        dataTextField4.setData(dataSource1);
        dataTextField4.setEnabled(false);
        panel1.add(dataTextField4, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 360, 240, -1));

        dataMaskedTextField2.setCampo("telefono");
        dataMaskedTextField2.setData(dataSource1);
        dataMaskedTextField2.setEnabled(false);
        try {
            dataMaskedTextField2.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-###-##-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        dataMaskedTextField2.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                dataMaskedTextField2FocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                dataMaskedTextField2FocusLost(evt);
            }
        });
        panel1.add(dataMaskedTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 400, 240, -1));

        dataMaskedTextField3.setCampo("f_nac");
        dataMaskedTextField3.setData(dataSource1);
        dataMaskedTextField3.setEnabled(false);
        try {
            dataMaskedTextField3.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####-##-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        dataMaskedTextField3.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                dataMaskedTextField3FocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                dataMaskedTextField3FocusLost(evt);
            }
        });
        panel1.add(dataMaskedTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 440, 240, -1));

        dataLabel1.setForeground(new java.awt.Color(255, 255, 255));
        dataLabel1.setText("Estatus------");
        dataLabel1.setCampo("motivo");
        dataLabel1.setData(dataSource1);
        dataLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 18));
        dataLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        panel1.add(dataLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 480, 240, 30));

        jLabel11.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 16));
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel11.setText("Estatus:");
        panel1.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 480, -1, 20));

        buttonSeven10.setText("Inhabilitar");
        buttonSeven10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSeven10ActionPerformed(evt);
            }
        });
        panel1.add(buttonSeven10, new org.netbeans.lib.awtextra.AbsoluteConstraints(612, 253, -1, -1));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(panel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 788, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 518, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonSeven4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven4ActionPerformed
        this.datahabilitador1.deshabilitaredison(panel1, this.buttonSeven1);
         this.buttonSeven1.setEnabled(true);
        this.limpiar();
        this.activar();
}//GEN-LAST:event_buttonSeven4ActionPerformed
public void limpiar(){
    this.dataTextField1.setText("");
    this.dataTextField2.setText("");
    this.dataTextField3.setText("");
    this.dataTextField4.setText("");
    this.dataMaskedTextField1.setText("");
    this.dataMaskedTextField2.setText("");
   this.dataMaskedTextField3.setText("");
    this.dataRadioButton1.setSelected(false);
    this.dataRadioButton2.setSelected(false);
    this.dataCombobox1.setSelectedIndex(0);
    this.dataCombobox2.setSelectedIndex(0);
}
public void activar(){
    this.buttonSeven3.setEnabled(true);
    this.datahabilitador1.habilitaredisonmultiple(panel1, this.dataMaskedTextField1, this.dataTextField1);
    this.datahabilitador1.habilitaredisonmultiple(panel1, this.dataRadioButton1, this.dataCombobox1);
}
public void desactivar(){
    this.datahabilitador1.deshabilitaredisonmultiple(panel1, this.dataMaskedTextField1, this.dataTextField1);
    this.datahabilitador1.deshabilitaredisonmultiple(panel1, this.dataRadioButton1, this.dataCombobox1);
}
    private void buttonSeven5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven5ActionPerformed
      this.dataSource1.primero();
    }//GEN-LAST:event_buttonSeven5ActionPerformed

    private void buttonSeven6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven6ActionPerformed
      this.dataSource1.anterior();
    }//GEN-LAST:event_buttonSeven6ActionPerformed

    private void buttonSeven7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven7ActionPerformed
        this.dataSource1.siguiente();
    }//GEN-LAST:event_buttonSeven7ActionPerformed

    private void buttonSeven8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven8ActionPerformed
        this.dataSource1.ultimo();
    }//GEN-LAST:event_buttonSeven8ActionPerformed

    private void dataRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataRadioButton1ActionPerformed
      this.dataRadioButton2.setSelected(false);
    }//GEN-LAST:event_dataRadioButton1ActionPerformed

    private void dataRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataRadioButton2ActionPerformed
     this.dataRadioButton1.setSelected(false);
    }//GEN-LAST:event_dataRadioButton2ActionPerformed

    private void dataMaskedTextField1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField1FocusGained
       this.dataMaskedTextField1.setFormatterFactory(for1);
    }//GEN-LAST:event_dataMaskedTextField1FocusGained

    private void dataMaskedTextField2FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField2FocusGained
        this.dataMaskedTextField2.setFormatterFactory(for2);
    }//GEN-LAST:event_dataMaskedTextField2FocusGained

    private void dataMaskedTextField3FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField3FocusGained
        this.dataMaskedTextField3.setFormatterFactory(for3);
    }//GEN-LAST:event_dataMaskedTextField3FocusGained

    private void dataMaskedTextField1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField1FocusLost
        this.dataMaskedTextField1.setFormatterFactory(null);
    }//GEN-LAST:event_dataMaskedTextField1FocusLost

    private void dataMaskedTextField2FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField2FocusLost
         this.dataMaskedTextField2.setFormatterFactory(null);
    }//GEN-LAST:event_dataMaskedTextField2FocusLost

    private void dataMaskedTextField3FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_dataMaskedTextField3FocusLost
        this.dataMaskedTextField3.setFormatterFactory(null);
    }//GEN-LAST:event_dataMaskedTextField3FocusLost

    private void buttonSeven3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven3ActionPerformed
        this.limpiar();
        this.desactivar();
        this.datahabilitador1.habilitaredison(panel1, this.buttonSeven1);
        this.buttonSeven1.setEnabled(false);
        this.dataSource1.consulta();
        ban=false;
    }//GEN-LAST:event_buttonSeven3ActionPerformed

    private void buttonSeven2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven2ActionPerformed
        this.activar();
        ban=true;
        this.dataMaskedTextField1.setEnabled(false);
        this.datahabilitador1.deshabilitaredison(panel1, this.buttonSeven1);
        this.buttonSeven1.setEnabled(true);
        this.buttonSeven3.setEnabled(true);
    }//GEN-LAST:event_buttonSeven2ActionPerformed

    private void buttonSeven1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven1ActionPerformed

        String genero="", resp="";
        if(this.dataRadioButton1.isSelected()){
        genero="M";
        }else if(this.dataRadioButton2.isSelected()){
        genero="F";
        }

       if(ban==true){
                     resp= this.dataSource1.ejecutarPA("call sp_modificar_donador ('"+this.dataMaskedTextField1.getText()+"','"+this.dataTextField1.getText()+"','"+
            this.dataTextField2.getText()+"','"+this.dataTextField3.getText()+"','"+this.dataMaskedTextField3.getText()+"','"+genero+"','"+this.dataCombobox1.getSelectedItem()+
            "','"+this.dataCombobox2.getSelectedItem()+"','"+this.dataTextField4.getText()+"',"+this.padre+",'"+this.dataMaskedTextField2.getText()+"',@r);");
        new Error(this,true,resp,0,"¡ATENCION!").setVisible(true);

        if(resp.equals("Modificación Hecha")){
            this.limpiar();
            this.desactivar();
        this.datahabilitador1.habilitaredison(panel1, this.buttonSeven1);
        this.buttonSeven1.setEnabled(false);
        this.dataSource1.consulta();
        ban=false;
        }
        else if(resp.equals("Usted no puede Modificar este Donador")){
            this.desactivar();
        this.datahabilitador1.habilitaredison(panel1, this.buttonSeven1);
        this.buttonSeven1.setEnabled(false);
        this.dataSource1.consulta();
        ban=false;

        }
       }else{
           resp= this.dataSource1.ejecutarPA("call sp_insertar_donador ('"+this.dataMaskedTextField1.getText()+"','"+this.dataTextField1.getText()+"','"+
            this.dataTextField2.getText()+"','"+this.dataTextField3.getText()+"','"+this.dataMaskedTextField3.getText()+"','"+genero+"','"+this.dataCombobox1.getSelectedItem()+
            "','"+this.dataCombobox2.getSelectedItem()+"','"+this.dataTextField4.getText()+"',"+this.padre+",'"+this.dataMaskedTextField2.getText()+"',@r);");
        new Error(this,true,resp,0,"¡ATENCION!").setVisible(true);
        if(resp.equals("Donador Agregado Correctamente")){
            this.limpiar();
            this.desactivar();
         this.datahabilitador1.habilitaredison(panel1, this.buttonSeven1);
         this.buttonSeven1.setEnabled(false);
        this.dataSource1.consulta();
        }
       }
    }//GEN-LAST:event_buttonSeven1ActionPerformed

    private void buttonSeven9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven9ActionPerformed
        ComboBoxModel modelo=(new javax.swing.DefaultComboBoxModel(new String[] {"CURP" ,"Nombre", "ApellidoP", "ApellidoM","Direccion","Telefono" }));
        new busqueda(this,true,"vw_donador",modelo,this.dataSource1,"BUSQUEDA DE DONADORES","rptDonadores").activar();
    }//GEN-LAST:event_buttonSeven9ActionPerformed

    private void buttonSeven10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSeven10ActionPerformed
        if(this.dataLabel1.getText().equals("No Apto para Donación")){
            new Error(this,true,"El Donador ya fue Inhabilitado",0,"¡ATENCION!").setVisible(true);
        }else{
        String resp=this.dataSource1.ejecutarPA("call sp_inhabilitar_donador('"+this.dataMaskedTextField1.getText()+"',@r);");
        new Error(this,true,resp,0,"¡ATENCION!").setVisible(true);
        this.dataSource1.consulta();

        }
    }//GEN-LAST:event_buttonSeven10ActionPerformed

    private void dataCombobox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataCombobox1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_dataCombobox1ActionPerformed
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Donadores2(0).setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.edisoncor.gui.button.ButtonSeven buttonSeven1;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven10;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven2;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven3;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven4;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven5;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven6;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven7;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven8;
    private org.edisoncor.gui.button.ButtonSeven buttonSeven9;
    private FuenteDeDatos.DataCombobox dataCombobox1;
    private FuenteDeDatos.DataCombobox dataCombobox2;
    private FuenteDeDatos.DataLabel dataLabel1;
    private FuenteDeDatos.DataMaskedTextField dataMaskedTextField1;
    private FuenteDeDatos.DataMaskedTextField dataMaskedTextField2;
    private FuenteDeDatos.DataMaskedTextField dataMaskedTextField3;
    private FuenteDeDatos.DataRadioButton dataRadioButton1;
    private FuenteDeDatos.DataRadioButton dataRadioButton2;
    private FuenteDeDatos.DataSource dataSource1;
    private FuenteDeDatos.DataTextField dataTextField1;
    private FuenteDeDatos.DataTextField dataTextField2;
    private FuenteDeDatos.DataTextField dataTextField3;
    private FuenteDeDatos.DataTextField dataTextField4;
    private FuenteDeDatos.Datahabilitador datahabilitador1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private Comun.PanelRoundTranslucido panel1;
    // End of variables declaration//GEN-END:variables
}
